
import math

print('\n')
print("="*63)
w_1 = 1
while w_1 <= 9:
    w_1_1 = 1
    str_format = ""
    while w_1_1 <= w_1:
        str_format = str_format + "{}*{}={:<3}".format(w_1_1,w_1,w_1*w_1_1)
        w_1_1 +=1
    print(str_format)
    w_1 +=1
print("="*62)


w_2 = 9
while w_2 >= 1:
    w_2_2 = 1
    str_format = ""
    while w_2_2 <= w_2:
        str_format = str_format + "{}*{}={:<3}".format(w_2_2,w_2,w_2*w_2_2)
        w_2_2 +=1
    print(str_format)
    w_2 -=1
print("="*62)



w_3 = 1
while w_3 <= 9:
    w_3_3 = w_3
    str_format = ""
    while w_3_3 >= 1:
        str_format = str_format + "{}*{}={:<3}".format(w_3_3,w_3,w_3*w_3_3)
        w_3_3 -=1
    print("{:>63}".format(str_format))
    w_3 +=1
print("="*62)
w_4 = 9
while w_4 >= 1:
    w_4_4 = w_4
    str_format = ""
    while w_4_4 >= 1:
        str_format = str_format + "{}*{}={:<3}".format(w_4_4,w_4,w_4*w_4_4)
        w_4_4 -=1
    print("{:>63}".format(str_format))
    w_4 -=1


print("="*62)
for f_1 in range(1,10):
    str_format = ""
    for f_1_1 in range(1,f_1+1):
        str_format = str_format + "{}*{}={:<3}".format(f_1_1,f_1,f_1*f_1_1)
    print(str_format)
print("="*63)
for f_2 in range(9,0,-1):
    str_format = ""
    for f_2_2 in range(1,f_2+1):
        str_format = str_format + "{}*{}={:<3}".format(f_2_2,f_2,f_2*f_2_2)
    print(str_format)

print("="*63)
for f_3 in range(1,10):
    str_format = ""
    for f_3_3 in range(f_3,0,-1):
        str_format = str_format + "{}*{}={:<3}".format(f_3_3,f_3,f_3*f_3_3)
    print("{:>63}".format(str_format))

print("="*63)
for f_4 in range(9,0,-1):
    str_format = ""
    for f_4_4 in range(f_4,0,-1):
        str_format = str_format + "{}*{}={:<3}".format(f_4_4,f_4,f_4*f_4_4)
    print("{:>63}".format(str_format))
print("="*63)